/**************************************************************************************************

	NSurvey - The web survey and form engine
	Copyright (c) 2004, Thomas Zumbrunn. (http://www.nsurvey.org)

	Dotnetnuke PA module 
	Copyright (c) 2004, Oliver Hine (oliver.hine@gmail.com)

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.


************************************************************************************************/
using System;
using System.Security.Principal;
using System.Web;

namespace Votations.NSurvey.WebAdmin.Helpers
{
	/// <summary>
	/// Summary description for NukeHelper.
	/// </summary>
	public class WebHelper
	{
		public static HttpContext CurrentContext
		{
			get
			{
				return HttpContext.Current;
			}
		}

		public static HttpRequest CurrentRequest
		{
			get
			{
				return HttpContext.Current.Request;
			}
		}
 
		public static HttpResponse CurrentResponse
		{
			get
			{
				return HttpContext.Current.Response;
			}
		}

		public static IPrincipal CurrentUser
		{
			get
			{
				return HttpContext.Current.User;
			}
		}

		public static int GetInteger(string name)
		{
			if ((WebHelper.CurrentRequest[name] != "") && Microsoft.VisualBasic.Information.IsNumeric(WebHelper.CurrentRequest[name]))
			{
				return Convert.ToInt32(WebHelper.CurrentRequest[name]);
			}
			else {return DotNetNuke.Common.Utilities.Null.NullInteger;}
			
		}
 


	}
}
